<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml" layout:decorate="~{layout/template}">
<head>
    <title>列表</title>
    <link rel="stylesheet" href="/css/system/dataset/list.css"/>
</head>
<body>
<div id="contentContainer" layout:fragment="content" class="contentContainer" v-cloak>
    
    <el-row id="toolbar">
        <el-col :span="12">
            <div class="pull-left">
                <el-input v-model="datasetName" @keyup.enter.native="onSearch" class="searchBox"
                          placeholder="请输入数据集名称"></el-input>
                <el-button type="primary" @click.native="onSearch">
                    <i class="fa fa-search"></i>
                    <span>查询</span>
                </el-button>
            </div>
        </el-col>
        <el-col :span="12">
            <div class="pull-right">
                <el-button-group>
                    <el-button th:if="${addFunc!=null}" @click.native="onAdd">
                        <i th:class="${addFunc.iconClass}"></i>
                        <span th:text="${addFunc.name}"></span>
                    </el-button>
                    <el-button th:if="${editFunc!=null}" @click.native="onEdit">
                        <i th:class="${editFunc.iconClass}"></i>
                        <span th:text="${editFunc.name}"></span>
                    </el-button>
                    <el-button th:if="${deleteFunc!=null}" @click.native="onDelete">
                        <i th:class="${deleteFunc.iconClass}"></i>
                        <span th:text="${deleteFunc.name}"></span>
                    </el-button>
                </el-button-group>
            </div>
        </el-col>
    </el-row>

    <el-row>
        <el-table
                ref="multipleTable"
                border
                tooltip-effect="light"
                class="dataTable"
                :data="tableData"
                :height="tableHeight"
                @selection-change="onSelectionChange">
            <el-table-column
                    type="selection"
                    width="50">
            </el-table-column>
            <el-table-column
                    prop="datasetId"
                    label="数据集ID"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="datasetName"
                    label="数据集名称"
                    width="130">
            </el-table-column>
            <el-table-column
                    prop="remark"
                    label="备注"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="sqlString"
                    label="数据集SQL">
            </el-table-column>
        </el-table>
    </el-row>

    <el-row id="pagination">
        <div class="pull-right">
            <el-pagination
                    layout="total, sizes, prev, pager, next, jumper"
                    :current-page="pageNum"
                    :page-size="pageSize"
                    :page-sizes="pageSizes"
                    :total="total"
                    @size-change="onSizeChange"
                    @current-change="onCurrentChange">
            </el-pagination>
        </div>
    </el-row>

</div>

<th:block layout:fragment="staticFile">
    <script src="/js/system/dataset/list.js"></script>
</th:block>

</body>
</html>